#include<iostream>
using namespace std;
class CXGraph
{
    private:
        int n;
    public:
        CXGraph(int _n):n(_n){}
        friend ostream& operator<<(ostream& os,const CXGraph& a)
        {
            int col=a.n;
            for(int i=0;i<col/2+1;++i)
            {
                for(int j=0;j<i;++j)
                {
                    os<<" ";
                }
                for(int j=col-2*i;j>0;--j)
                {
                    os<<"X";
                }
                os<<endl;
            }
            for(int i=col/2-1;i>=0;--i)
            {
                for(int j=0;j<i;++j)
                {
                    os<<" ";
                }
                for(int j=col-2*i;j>0;--j)
                {
                    os<<"X";
                }
                os<<endl;
            }
            os<<endl;
            return os;
        }
        CXGraph& operator++()
        {
            if(n==21)
                return *this;
            n+=2;
            return *this;
        }
        CXGraph operator++(int)
        {
            if(n==21)
                return *this;
            CXGraph tmp(*this);
            n+=2;
            return tmp;
        }
        CXGraph& operator--()
        {
            if(n==1)
                return *this;
            n-=2;
            return *this;
        }
        CXGraph operator--(int)
        {
            if(n==1)
                return *this;
            CXGraph tmp(*this);
            n-=2;
            return tmp;
        }
};
int main()
{
    int t, n;
    string command;
    cin >> n;
    CXGraph xGraph(n);
    cin >> t;
    while (t--)
    {
        cin >> command;
        if (command == "show++")
        {
            cout << xGraph++ << endl;
        }
        else if(command == "++show")
        {
            cout << ++xGraph << endl;
        }
        else if (command == "show--")
        {
            cout << xGraph-- << endl;
        }
        else if (command == "--show")
        {
            cout << --xGraph << endl;
        }
        else if (command == "show")
        {
            cout << xGraph << endl;
        }
    }
    return 0;
}